Hi,
I need to randomize the order of a returned list from a database selecter. The best option for this seemsed to write a simple script. The passing of variables is ok, but my script doenst sort the list for some reason. Hope anyone can see my mistake or propose a other sollution.
#input Integer[] list
#output Integer[] mixedList
import java.util.*;
import java.util.Collections;
import java.util.Arrays;
Collections.shuffle(Arrays.asList(list))
return ["mixedList": list]
This work in normal java so should be no problem for groovy but my experience is limited with the groovy language.